import pandas as pd
from config import DATA_PATH


def load_data():
    try:
        df = pd.read_csv(DATA_PATH)
        print(" 数据加载成功")
        return df
    except FileNotFoundError:
        raise FileNotFoundError(f"找不到文件：{DATA_PATH}，请确认路径是否正确")


def check_label_column(df, label_col='HeartDisease'):
    if label_col not in df.columns:
        raise KeyError(f"列 '{label_col}' 不存在，请检查数据集内容")
    return df
